package com.yanqu.road.server.cmd.orewar;

import com.yanqu.road.entity.player.UserBaseInfo;
import com.yanqu.road.logic.pb.PlayerBasePb;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.orewar.OreWarProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.orewar.CrossOreWarMgr;
import com.yanqu.road.server.protocol.CrossProtocol;

import java.util.List;

@Cmd(code = CrossProtocol.C_CROSS_ORE_WAR_ALL_PATRONS_SYNC,desc = "")
public class CrossPatronsPlayerAllSyncCmd  extends CrossUnionCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        OreWarProto.CrossPatronsListAbilityChangeSyncMsg syncMsg = OreWarProto.CrossPatronsListAbilityChangeSyncMsg.parseFrom(packet.getBytes());
        int activityId = syncMsg.getActivityId();
        List<OreWarProto.CrossOreWarPatronsSyncMsg> patronsMsgList = syncMsg.getPatronsMsgList();
        UserBaseInfo userBaseInfo = PlayerBasePb.parseToUserBaseInfo(syncMsg.getPlayerBaseData());

        CrossOreWarMgr.allPatronsAbilityChange(packet.getPlayerId(), userBaseInfo, activityId, patronsMsgList,groupId);
    }

    @Override
    public void sendData() {

    }
}
